package com.hjt.gulimall.order.feign;

import com.hjt.common.to.order.WareLockTo;
import com.hjt.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 库存服务远程调用
 * @author:97007
 * @date:2021/10/10 11:04
 */
@FeignClient("gulimall-ware")
public interface WareFeignService {
    @PostMapping("/ware/waresku/hastStock")
    R getSkuHasStock(@RequestBody List<Long> skuIdList);

    // 获取运费
    @GetMapping("/ware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);

    /**
     * 锁定sku库存
     * @return
     */
    @PostMapping("/ware/waresku/lock")
    R lockSku(@RequestBody WareLockTo wareLockTo);
}
